import std.stdio;
import nkf;

version (Win32)
{

pragma(lib, "..\\win32\\nkf_d.lib");

}

enum string USAGE = 
"Usage: %s infile"
    ;

int main(string[] args)
{
    if (args.length < 2)
    {
        writefln(USAGE, args[0]);
        return -1;
    }
    
    auto infile = File(args[1], "r");
    
    {
        string buf;
        
        while (!infile.eof)
        {
            buf ~= infile.readln();
        }
        
        writeln(nkf.guess(buf));
    }
    
    return 0;
}